<?php

namespace app\common\model;

use think\Model;

class GroupModel extends Model
{
    protected $name = 'group';

    public function getGroupData(): array
    {
        return $this->order('id DESC')->paginate(tp_page())->toArray();
    }

    public function getGroupDataByStatus(array $params): array
    {
        return $this->where(['isManager'=>1,'robot_wxid'=>$params['robot_wxid']])->select()->toArray();
    }

    public function getGroupByWhere($where):array
    {
        return $this->where($where)->select()->toArray();
    }

    public function getOneGroupData(array $where): array
    {
        return $this->where($where)->findOrEmpty()->toArray();
    }


}